wayland: Support pad devices in gdk_wayland_device_get_node_path()
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 4 Aug 2016 17:46:04 +0000 (19:46 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 23 Aug 2016 19:01:45 +0000 (21:01 +0200)
We can return the node path on those too, so do that.

https://bugzilla.gnome.org/show_bug.cgi?id=770026

gdk/wayland/gdkdevice-wayland.c

index 76ede9e2c57ea7caefe51abe434a6ba28d5e7230..70b95d47f467eaf7a7d4abdc0e7dceefb5721349 100644 (file)
@@ -5176,7 +5176,7 @@ gdk_wayland_device_get_drop_context (GdkDevice *device)
  * will return %NULL.
  *
  * This is most notably implemented for devices of type
- * %GDK_SOURCE_PEN and %GDK_SOURCE_ERASER.
+ * %GDK_SOURCE_PEN, %GDK_SOURCE_ERASER and %GDK_SOURCE_TABLET_PAD.
  *
  * Returns: the /dev/input/event* path of this device
  **/
@@ -5184,6 +5184,7 @@ const gchar *
 gdk_wayland_device_get_node_path (GdkDevice *device)
 {
   GdkWaylandTabletData *tablet;
+  GdkWaylandTabletPadData *pad;
 
   GdkSeat *seat;
 
@@ -5195,5 +5196,9 @@ gdk_wayland_device_get_node_path (GdkDevice *device)
   if (tablet)
     return tablet->path;
 
+  pad = gdk_wayland_device_manager_find_pad (GDK_WAYLAND_SEAT (seat), device);
+  if (pad)
+    return pad->path;
+
   return NULL;
 }